var initFoodInfoSearchPage = function(){
	jQuery('#ligerStateSearcher').ligerComboBox({
		data:foodStateRenderData,
		valueField:'value',
		textField:'text',
		valueFieldID:'stateSearcher'
	});
	jQuery('#ligerTypeSearcher').ligerComboBox({
		data:foodTypes,
		valueField:'id',
		textField:'name',
		valueFieldID:'typeSearcher'
	});
};

var getFoodInfoSearchParams = function(){
	var foodinfoBean = {};
	var temp;
	temp = jQuery('#nameSearcher').val();
	if(temp){
		foodinfoBean.name = temp;
	}
	temp = jQuery('#typeSearcher').val();
	if(temp){
		foodinfoBean.type = temp;
	}
	temp = jQuery('#areaIdSearcher').val();
	if(temp){
		foodinfoBean.areaId = temp;
	}
	temp = jQuery('#stateSearcher').val();
	if(temp){
		foodinfoBean.state = temp;
	}
	temp = jQuery('#shopIdSearcher').val();
	if(temp){
		foodinfoBean.shopId = temp;
	}
	temp = jQuery('#picSearcher').val();
	if(temp){
		foodinfoBean.pic = temp;
	}
	temp = jQuery('#labelPriceSearcher').val();
	if(temp){
		foodinfoBean.labelPrice = temp;
	}
	temp = jQuery('#realPriceSearcher').val();
	if(temp){
		foodinfoBean.realPrice = temp;
	}
	temp = jQuery('#efficacySearcher').val();
	if(temp){
		foodinfoBean.efficacy = temp;
	}
	temp = jQuery('#descSearcher').val();
	if(temp){
		foodinfoBean.desc = temp;
	}
	return foodinfoBean;
}

jQuery(function(){
	initFoodInfoSearchPage();
	jQuery('#searchFoodInfo').click(function(){
		foodinfoManager.loadServerData(getFoodInfoSearchParams());
	});
});


